<?php

namespace App\Http\Controllers\Invoice\Internal;

use App\Http\Controllers\BaseController;
use App\Models\Invoice\InvoiceHistoryModel;
use Illuminate\Http\Request;

class InvoiceController extends BaseController
{
    public function invoiceList(Request $request)
    {
        $invoiceIds = $request->get('invoice_ids');

        $this->validate($request, [
            'invoice_ids' => 'required|array',
        ]);

        $data = InvoiceHistoryModel::query()
                                   ->whereIn('id', $invoiceIds)
                                   ->select('id', 'status', 'blueInvoiceOssFile')
                                   ->get()
                                   ->toArray();

        return $this->success($data);
    }
}
